<template>
    <div class="returnExample">
      <div class="blockItemReturn successBlock" @click="successReturn">
        <span>成功示例</span>
        <el-button type="text" icon="el-icon-edit">编辑</el-button>
      </div>
      <div class="blockItemReturn errorBlock" @click="errorReturn">
        <span>失败示例</span>
        <el-button type="text" icon="el-icon-edit">编辑</el-button>
      </div>
      <!--dialog-->
      <el-dialog
        custom-class="dhcWebLayer"
        top="0"
        :close-on-click-modal="false"
        title="返回示例"
        :visible.sync="dialogVisibleReturnExample"
        width="70%">
        <successReturnExample ref="successReturnExampleDom" @closeFun="closeFunSuccess"></successReturnExample>
      </el-dialog>
      <el-dialog
        custom-class="dhcWebLayer"
        top="0"
        :close-on-click-modal="false"
        title="返回示例"
        :visible.sync="dialogVisibleReturnExampleError"
        width="70%">
        <errorReturnExample ref="errorReturnExampleDom" @closeFun="closeFunError"></errorReturnExample>
      </el-dialog>
    </div>
</template>

<script>
import successReturnExample from './addApi/successReturnExample'
import errorReturnExample from './addApi/errorReturnExample'
export default {
  name: 'returnExample',
  components: {
    successReturnExample,
    errorReturnExample
  },
  data() {
    return {
      successData: {},
      errorData: {},
      dialogVisibleReturnExample: false,
      dialogVisibleReturnExampleError: false
    }
  },
  methods: {
    getDialogMsg() {
      const successData = this.successData
      const errorData = this.errorData
      console.log(Object.assign(successData, errorData))
      return Object.assign(successData, errorData)
    },
    closeFun() {
      this.dialogVisibleReturnExample = false
      this.dialogVisibleReturnExampleError = false
    },
    closeFunSuccess(val) {
      this.successData = val
      this.dialogVisibleReturnExample = false
    },
    closeFunError(val) {
      this.errorData = val
      this.dialogVisibleReturnExampleError = false
    },
    successReturn() {
      this.dialogVisibleReturnExample = true
    },
    errorReturn() {
      this.dialogVisibleReturnExampleError = true
    }
  }
}
</script>

<style scoped>

</style>
